Popular Searches
Popular Course Categories
Popular Courses

Understanding Data Types

Dimensions, Measures, and Data Types

Understanding Data Types in Tableau

Course: Tableau Data Visualization and Business Intelligence

Topic: Data Types, Field Classification, Data Type Conversion, Data Validation, and Practical Analysis

Course Link: JustAcademy Tableau Training

Demo Link: Register for a Tableau Course Demo


1. Introduction to Data Types

Data types define the kind of information stored in a field. In Tableau, every field in a data source has a data type that helps Tableau understand how to interpret, format, calculate, and visualize the information.

For example, a field containing customer names should be interpreted as text, a field containing order dates should be interpreted as a date, and a field containing sales amounts should generally be interpreted as a number.

Correct data types are important because they determine which operations and calculations can be performed on a field. Incorrect data types may cause calculation errors, missing values, inaccurate results, or unsuitable visualizations.

Tableau supports several data types, including:

  • String or Text
  • Number (Whole)
  • Number (Decimal)
  • Date
  • Date & Time
  • Boolean
  • Geographic roles and geographic values
  • Image roles and cluster groups in supported contexts

The data types available can depend on the data source, connection, and Tableau feature being used. Read the official Tableau Data Types documentation.


2. Why Are Data Types Important?

Data types help Tableau interpret information correctly and determine which operations are appropriate for each field.

Key Benefits

  • Accurate calculations: Numerical fields can be used for mathematical operations.
  • Correct date analysis: Date fields support time-based analysis, date filters, and date calculations.
  • Meaningful visualizations: Geographic fields can be used to create maps, while text fields can define categories.
  • Reliable filtering: The correct data type makes it easier to filter values using suitable conditions.
  • Better data quality: Identifying incorrect data types helps reveal inconsistencies in source data.
  • Valid calculations: Many Tableau functions require particular data types.
  • Improved reporting: Correct field interpretation helps create understandable dashboards and reports.

Example

Suppose a dataset contains a Sales field with values stored as text:

Sales
1000
2000
3000

If Tableau interprets these values as strings rather than numbers, numerical aggregation may not work as intended. Converting the field to a suitable numeric type allows Tableau to calculate the total sales.

SUM(Sales) = 6000

This example assumes the values are valid numeric amounts and that the field has been correctly converted.


3. String or Text Data Type

The String data type stores text made up of characters. A string may contain letters, numbers, spaces, punctuation marks, or combinations of these characters.

Examples

Field Example Value Purpose
Customer Name Rahul Sharma Stores a customer's name
City Mumbai Stores a location label
Product Name Laptop Identifies a product
Order Code ORD-1025 Stores an order identifier
Postal Code 400001 Stores a code that may contain leading zeros
Email [email protected] Stores an email address

Characteristics of String Data

  • Stores textual information.
  • Can contain letters, numbers, symbols, and spaces.
  • Is useful for labels, categories, names, and identifiers.
  • Supports text operations such as searching, combining, and changing letter case.
  • Does not behave like a numeric field simply because its contents look like numbers.

Example of a String Calculation

Tableau provides functions such as UPPER, LOWER, TRIM, and STR for working with text and conversions.

UPPER("tableau")

Result:

TABLEAU

Another example removes leading and trailing spaces:

TRIM(" Mumbai ")

Result:

Mumbai

When Should You Use String Data?

  • Customer names and employee names
  • Product descriptions
  • Regions and categories
  • Order numbers and reference codes
  • Phone numbers and postal codes that should not be mathematically calculated

Important: A value such as "00125" may need to remain text if the leading zeros are meaningful. Converting it to a number could remove those zeros.


4. Number (Whole) Data Type

The Number (Whole) data type stores integers, which are numbers without a fractional or decimal part.

Examples

10
250
1500
-25
0

Typical Uses

  • Number of products sold
  • Number of employees
  • Number of orders
  • Inventory quantities
  • Whole-number counts

Example

Suppose a shop sells 10, 15, and 20 products across three transactions. The Quantity field can use a whole-number data type.

SUM(Quantity) = 45

This calculation returns the total number of units across the included records.

Important: Not every integer is a measure. Customer IDs, product codes, and other numeric identifiers may be better represented as dimensions or strings because adding or averaging identifiers usually has no useful business meaning.


5. Number (Decimal) Data Type

The Number (Decimal) data type stores numeric values that include fractional parts. It is useful when precision beyond a whole number is required.

Examples

10.50
25.75
99.99
0.25
-12.50

Typical Uses

  • Sales amounts with decimal values
  • Profit and cost calculations
  • Discount rates
  • Percentages and ratios
  • Average ratings
  • Measurements such as weight or distance

Example

Suppose three products have prices of ₹99.50, ₹150.75, and ₹200.25.

SUM(Price) = 450.50
AVG(Price) = 150.1666...

The average may be displayed with a chosen number of decimal places, such as ₹150.17, depending on formatting.

Whole Numbers vs Decimal Numbers

Feature Number (Whole) Number (Decimal)
Values Integer values Integer or fractional values
Example 25 25.75
Common use Counts and whole quantities Prices, ratios, measurements
Precision No fractional part Can represent fractional values

Note: Floating-point calculations may sometimes produce tiny rounding differences. Use appropriate numeric types, calculations, and display formatting for the precision required by the analysis.


6. Date Data Type

The Date data type stores calendar dates, such as year, month, and day, without requiring a time component.

Examples

2026-01-15
2026-05-20
2026-10-14

Typical Uses

  • Order dates
  • Customer registration dates
  • Employee joining dates
  • Delivery dates
  • Invoice dates
  • Project start and completion dates

Benefits of Date Fields

  • Allow analysis by year, quarter, month, week, or day.
  • Support date-based filtering.
  • Enable trend analysis over time.
  • Support date calculations, such as finding the difference between dates.
  • Allow date hierarchies and drill-down in visualizations.

Example: Sales by Date

Suppose a dataset contains an Order Date field and a Sales field. Drag Order Date to Columns and Sales to Rows to create a date-based sales view.

You can change the date level to Year, Quarter, Month, or Day, depending on the question you want to answer.

Example of a Date Calculation

DATE(#2026-01-15#)

This expression returns a date value for January 15, 2026.

For text values containing dates, Tableau may require conversion to a date type before date calculations can be performed.


7. Date & Time Data Type

The Date & Time data type stores both a calendar date and a time component. It is useful when the time of an event is important to the analysis.

Examples

2026-01-15 09:30:00
2026-05-20 14:45:30
2026-10-14 18:15:00

Typical Uses

  • Transaction timestamps
  • Website activity logs
  • Customer service events
  • Delivery timestamps
  • Appointment records
  • System event monitoring

Date vs Date & Time

Feature Date Date & Time
Stores Calendar date Calendar date and time
Example 2026-01-15 2026-01-15 09:30:00
Useful for Daily or monthly analysis Detailed event and time analysis
Analysis example Orders by day Orders by hour or timestamp

Example: Analyze Orders by Hour

If the dataset contains a Date & Time field, you can examine the time of day when orders occur. Depending on the selected date part and view configuration, you can group records by hour or display timestamps in a more detailed timeline.

Important: Tableau's standard date/time type should not be confused with a dedicated time-only type. Tableau commonly represents time values using Date & Time.


8. Boolean Data Type

The Boolean data type represents logical values. Its possible values are TRUE and FALSE, with unknown results commonly represented as NULL in Tableau calculations.

Examples

TRUE
FALSE

Typical Uses

  • Identify whether an order is completed.
  • Check whether a customer is active.
  • Determine whether sales exceed a target.
  • Flag records that meet a condition.
  • Create filters based on logical conditions.

Example: Identify High Sales

Create a calculated field called High Sales Flag:

[Sales] >= 5000

The calculation returns TRUE when Sales is at least 5000 and FALSE when it is below 5000, assuming the sales value is not NULL.

Example: Filter Completed Orders

If a field named Order Status contains text values, a Boolean calculated field can identify completed orders.

[Order Status] = "Completed"

The resulting field can be used as a filter or displayed in the view to distinguish completed orders from other orders.

Note: The Boolean data type is supported in Tableau, but its availability and handling can vary by connection and data source.


9. Geographic Data and Geographic Roles

Geographic information is used to create maps and location-based visualizations. Fields such as country, state, city, and postal code can be assigned geographic roles so Tableau can interpret them as locations.

Examples of Geographic Fields

Field Example Possible Analysis
Country India Sales by country
State Maharashtra Sales by state
City Mumbai Customer distribution by city
Postal Code 400001 Location-level analysis
Latitude 19.0760 Map positioning
Longitude 72.8777 Map positioning

How to Assign a Geographic Role

  1. Locate the relevant field in the Data pane.
  2. Right-click the field or open its field menu.
  3. Choose Geographic Role.
  4. Select the appropriate role, such as Country/Region, State/Province, or City.
  5. Drag the field into the view to build a map when Tableau can identify the locations.

For latitude and longitude values, use appropriate geographic fields or roles supported by Tableau. Correctly assigned roles help Tableau interpret location values for mapping.

Important: Geographic role is not the same as a basic data type. A field may store text while also being assigned a geographic role that tells Tableau how to interpret its values.


10. Image Roles and Cluster Groups

10.1 Image Role

In supported Tableau workflows, a field can be used with an image role to display images associated with image links or supported image sources. This can be useful when visualizing products, people, or other items with associated pictures.

Example use cases include product catalog dashboards and visual reports containing image links. Availability depends on the Tableau version and feature being used.

10.2 Cluster Groups

Cluster groups are associated with Tableau's clustering functionality. Clustering groups data points with similar characteristics to help identify patterns or segments in a dataset.

For example, a dataset containing customer spending, order frequency, and average order value could be analyzed for customer segments with similar behavior.

Important: Image roles and cluster groups are specialized features, not ordinary replacements for string, number, date, or Boolean data types.


11. Understanding Data Type Icons in Tableau

Tableau displays icons beside field names in the Data pane to help identify the data type or role assigned to a field.

Data Type What It Represents Example
String Text values Customer Name
Number (Whole) Integer values Quantity
Number (Decimal) Decimal values Sales Amount
Date Calendar dates Order Date
Date & Time Date and time values Order Timestamp
Boolean Logical values Is Active
Geographic Role Location interpretation City or Country

The exact icons and available options can vary by Tableau version, data source, and field configuration. The icon is a quick way to check how Tableau is interpreting a field.


12. Difference Between Data Types, Dimensions, Measures, and Discrete/Continuous Fields

These concepts are related, but they mean different things. Understanding the distinction helps avoid errors when preparing data and building visualizations.

Concept Meaning Example
Data Type Defines what kind of information a field stores String, Number, Date
Dimension A field role commonly used for grouping and categorization Region, Category
Measure A field role commonly used for numerical analysis Sales, Profit
Discrete Displays distinct members or categories Category as a blue pill
Continuous Displays values along a continuous range Sales as a green pill
Geographic Role Tells Tableau how to interpret location information City, State, Country

For example, Sales may have a numeric data type, be classified as a measure, and be displayed as continuous in a visualization. Region may have a string data type, be classified as a dimension, and be displayed as discrete.

These are typical configurations rather than unchangeable rules. The best setup depends on the field's meaning and the analysis required.


13. How to Check Data Types in Tableau

Before creating visualizations, review the field data types to ensure that Tableau interprets the source data correctly.

Method 1: Check the Data Pane

  1. Open Tableau Desktop or Tableau Public.
  2. Connect to an Excel, CSV, database, or other supported data source.
  3. Open a worksheet.
  4. Look at the Data pane on the left.
  5. Inspect the icons beside the field names.
  6. Check whether dates, numbers, text, and Boolean fields are interpreted correctly.

Method 2: Check the Data Source Page

  1. Open the Data Source page.
  2. Review the fields and their displayed data types.
  3. Click a data type icon for a field.
  4. Inspect the available data type options.
  5. Choose the correct type if Tableau has interpreted the field incorrectly.

Example

If Order Date appears as a number, Tableau may not recognize the source values as dates. Changing the field to Date, when the source values are valid dates, can enable date-based analysis.

Check the data before creating an extract, because an incorrect type can affect how values are interpreted or stored in the resulting extract.


14. How to Change a Data Type

Sometimes Tableau automatically assigns an incorrect data type. You can change the field's data type through the Data Source page, the Data pane, or a calculation, depending on the situation.

Method 1: Change the Data Type on the Data Source Page

  1. Open the Data Source page.
  2. Find the field that needs correction.
  3. Click the data type icon beside the field name.
  4. Select the appropriate type from the menu.
  5. Verify that the sample values are interpreted correctly.

Method 2: Change the Data Type in the Data Pane

  1. Open a worksheet.
  2. Locate the field in the Data pane.
  3. Click the icon next to the field name.
  4. Select the desired data type.
  5. Review the field and its behavior in the worksheet.

Method 3: Use a Calculated Field

When you need a converted version of a field for a specific calculation, use a Tableau type conversion function.

Example: Convert a numeric postal code to a string.

STR([Postal Code])

This creates a text representation of the Postal Code field, which can help preserve its role as an identifier rather than a quantity.

Important: Available data type conversions depend on the source field, supported functions, and whether the values can be converted successfully.


15. Type Conversion Functions in Tableau

Type conversion functions change a value from one data type to another. They are useful when a field's current type does not match the operation you want to perform.

Function Purpose Example
STR() Converts a value to a string STR([Customer ID])
INT() Converts a value to an integer INT([Quantity])
FLOAT() Converts a value to a floating-point number FLOAT([Price])
DATE() Converts a supported expression to a date DATE([Order Date Text])
DATETIME() Converts a supported expression to a date and time DATETIME([Timestamp Text])
MAKEDATE() Constructs a date from year, month, and day values MAKEDATE(2026,10,14)

Example 1: Convert an ID to Text

STR([Customer ID])

This returns a string representation of Customer ID. It is useful when an identifier should be treated as text.

Example 2: Convert Text to a Date

DATE([Order Date Text])

This attempts to convert the field to a date if Tableau recognizes the format. If the date format is not recognized, you may need a different conversion approach, such as DATEPARSE where supported.

Example 3: Convert a Value to an Integer

INT([Quantity])

This converts the expression to an integer. Review the input values carefully because conversion may remove the fractional part or otherwise change the value.

Example 4: Construct a Date

MAKEDATE(2026,10,14)

This creates a date for October 14, 2026, in Tableau environments that support the function.

Note: Type conversion functions can behave differently for invalid values or different data sources. Validate the result before using it in a business report.

Reference: Official Tableau Type Conversion Documentation.


16. Handling Mixed Data Types

A column in an Excel or CSV file may contain a mixture of values, such as numbers, text, dates, and blank cells. Tableau typically assigns one data type to the field, so mixed values can lead to unexpected results.

Example

Order Value
1000
2000
Unknown
3000

If Tableau interprets this field as a number, the text value "Unknown" may be treated as NULL. This can affect calculations and totals.

Common Problems

  • Numbers stored as text cannot be aggregated as expected.
  • Dates stored as text may not support normal date calculations.
  • Text values in a numeric field may become NULL.
  • Empty cells can influence how mixed-value columns are interpreted.
  • Identifiers containing leading zeros may lose those zeros if converted to numbers.

How to Handle Mixed Data

  1. Inspect the source column for inconsistent values.
  2. Check whether numbers contain currency symbols or unexpected spaces.
  3. Standardize date formats in the source data when possible.
  4. Separate incompatible values into different columns when appropriate.
  5. Choose a data type that matches the field's intended purpose.
  6. Use type conversion functions where suitable.
  7. Check for NULL values after conversion.
  8. Validate totals and record counts after cleaning.

Best practice: Clean and standardize the source data whenever possible rather than relying only on conversions inside a visualization.


17. Practical Example Using a Sales Dataset

Consider the following sample sales data:

Order ID Order Date Customer Name Region Quantity Sales Completed
1001 2026-01-10 Rahul Sharma West 2 5000.50 TRUE
1002 2026-01-12 Priya Patel East 3 3000.00 TRUE
1003 2026-02-05 Amit Verma West 5 2000.75 FALSE
1004 2026-02-15 Neha Singh South 4 7000.25 TRUE

Suggested Field Data Types

Field Suggested Data Type Reason
Order ID Number (Whole) or String Stores an identifier; use String if formatting or leading zeros matter
Order Date Date Supports date-based analysis
Customer Name String Stores text
Region String Stores a category
Quantity Number (Whole) Stores units sold
Sales Number (Decimal) Stores monetary values with decimal precision
Completed Boolean Stores TRUE or FALSE

Analysis A: Total Sales

  1. Connect Tableau to the sales dataset.
  2. Verify that Sales is a numeric field.
  3. Drag Sales to the worksheet.
  4. Use SUM(Sales) to calculate total sales.
  5. Format the number as currency if appropriate.

Analysis B: Sales by Region

  1. Confirm Region is a text field.
  2. Drag Region to Columns.
  3. Drag Sales to Rows.
  4. Use SUM(Sales) as the measure.
  5. Create a bar chart to compare regional sales.

Analysis C: Sales Over Time

  1. Confirm Order Date is a date field.
  2. Drag Order Date to Columns.
  3. Drag Sales to Rows.
  4. Choose a suitable date level, such as Month.
  5. Use a line chart to examine the sales trend.

Analysis D: Completed Orders

  1. Confirm Completed is interpreted as a Boolean field, if supported by the connection.
  2. Drag Completed to Filters.
  3. Select TRUE to focus on completed records.
  4. Compare the filtered results with the unfiltered totals.

18. Common Data Type Errors and Solutions

Problem Possible Cause Solution
Sales cannot be summed correctly Sales is stored as text Convert the field to a numeric type after checking its values
Dates do not group by month Date values are stored as strings or numbers Convert the field to a valid date type
Postal codes lose leading zeros Postal codes were converted to numbers Store them as strings when leading zeros matter
Calculation returns an error Function arguments have incompatible types Check the function requirements and convert the values if appropriate
Unexpected NULL values appear Source values do not match the assigned data type Inspect and clean inconsistent values
Map does not show locations Geographic role is missing or locations are ambiguous Assign the correct geographic role and verify location values
Decimal precision appears incorrect Field type or display precision is unsuitable Review the source type, conversion, and number formatting

19. Best Practices for Managing Data Types

  • Review field data types immediately after connecting to a data source.
  • Choose types according to the meaning of the data, not just how the values look.
  • Use numeric types for values that require mathematical calculations.
  • Use text for identifiers when numeric operations are not meaningful or leading zeros matter.
  • Use Date and Date & Time fields for appropriate time-based analysis.
  • Check the source data for mixed values, unexpected spaces, and inconsistent formatting.
  • Use geographic roles for location-based fields when creating maps.
  • Understand the input and output types of Tableau calculation functions.
  • Validate values after changing a field's type.
  • Review NULL values and calculation errors before publishing dashboards.
  • Change field types before creating extracts when the type affects precision or interpretation.
  • Document important cleaning and conversion steps for repeatable analysis.

20. Interview Questions and Answers

Q1. What is a data type in Tableau?

Answer: A data type defines the kind of information stored in a field, such as text, numbers, dates, or Boolean values.

Q2. What are the common data types in Tableau?

Answer: Common types include String, Number (Whole), Number (Decimal), Date, Date & Time, and Boolean. Tableau also supports geographic roles and specialized features such as image roles and cluster groups in relevant contexts.

Q3. What is the difference between Number (Whole) and Number (Decimal)?

Answer: Number (Whole) represents integer values, while Number (Decimal) supports values with fractional parts.

Q4. What is a string data type?

Answer: A string stores text, including letters, symbols, spaces, and numeric-looking characters. Examples include customer names and order codes.

Q5. Why is a postal code often stored as text?

Answer: Postal codes are identifiers, not quantities. Storing them as text can preserve leading zeros and prevent inappropriate mathematical calculations.

Q6. What is the difference between Date and Date & Time?

Answer: Date represents a calendar date, while Date & Time represents both the date and the time component.

Q7. What is a Boolean field?

Answer: A Boolean field represents logical values such as TRUE and FALSE. It can be used for flags, conditions, and filters.

Q8. How can you change a field's data type?

Answer: Depending on the connection and field, you can change the data type from the Data Source page, the Data pane, or use a type conversion function in a calculated field.

Q9. What does STR() do in Tableau?

Answer: STR() converts a supported expression into a string representation.

Q10. What does DATE() do?

Answer: DATE() returns a date from a supported expression, such as a recognizable date string.

Q11. What happens when a numeric field contains text?

Answer: If Tableau interprets the field as numeric, incompatible text values may become NULL. Cleaning the source data or handling the values separately can prevent incorrect results.

Q12. What is a geographic role?

Answer: A geographic role tells Tableau how to interpret a field as location information, such as a country, state, or city, for geographic analysis.

Q13. Why should data types be checked before creating an extract?

Answer: Incorrect data types can affect how values are interpreted or stored. Reviewing the types first helps reduce errors, including possible loss of numeric precision.

Q14. What is type conversion?

Answer: Type conversion changes a value from one data type to another, such as converting text to a date or a numeric identifier to a string.

Q15. How do data types affect calculated fields?

Answer: Tableau functions require compatible input types. For example, date functions require date values, while text functions work with strings. Incompatible types can cause calculation errors.


21. Practical Exercises

Exercise 1: Identify Data Types

Identify the appropriate data type for each field.

Field Example Suggested Type
Employee Name Riya Shah String
Quantity 25 Number (Whole)
Price 149.99 Number (Decimal)
Order Date 2026-03-15 Date
Order Timestamp 2026-03-15 10:30:00 Date & Time
Is Completed TRUE Boolean
Postal Code 004001 String if leading zeros matter

Exercise 2: Fix an Incorrect Sales Field

A dataset contains a Sales field stored as text. Your task is to make the field suitable for numerical analysis.

  1. Inspect the values in the source data.
  2. Identify currency symbols, spaces, or invalid characters.
  3. Clean the values where necessary.
  4. Convert the field to a suitable numeric type.
  5. Calculate SUM(Sales).
  6. Compare the result against the source data to confirm accuracy.

Exercise 3: Convert Text Dates

A field named Order Date Text contains date values stored as text.

  1. Check the date format used in the source.
  2. Try converting the field to Date using Tableau's data type menu.
  3. If necessary, use a suitable conversion function.
  4. Check whether Tableau recognizes the values correctly.
  5. Create a monthly sales trend using the converted date field.

Exercise 4: Create a Boolean Flag

Create a calculated field named Sales Target Achieved.

[Sales] >= 5000

Use the field to distinguish records with sales of at least 5000 from records below the target. Test the calculation with several sample values.


22. Quick Revision Notes

  • Data Type: Defines the kind of information stored in a field.
  • String: Stores text and identifiers.
  • Number (Whole): Stores integer values.
  • Number (Decimal): Stores values with fractional parts.
  • Date: Stores calendar dates.
  • Date & Time: Stores dates and time values.
  • Boolean: Stores logical values such as TRUE and FALSE.
  • Geographic Role: Identifies a field as location information for mapping.
  • STR(): Converts an expression to text.
  • INT(): Converts a value to an integer.
  • FLOAT(): Converts a value to a floating-point number.
  • DATE(): Converts a supported expression to a date.
  • DATETIME(): Converts a supported expression to a date and time.
  • Mixed Data: May lead to NULL values or incorrect interpretation if types are inconsistent.
  • Best practice: Verify and clean data types before building visualizations.

23. Conclusion

Understanding data types is a fundamental Tableau skill. Data types determine how Tableau interprets values and which calculations, filters, and visualizations can be used. String, numeric, date, date-and-time, and Boolean fields each serve different purposes, while geographic roles support location-based analysis.

Before building a dashboard, verify the data types of important fields, correct any misclassified columns, and validate conversions. Clean data types help produce accurate calculations, meaningful charts, and reliable business insights.

Continue your learning with JustAcademy Tableau Training or Register for a Tableau Course Demo.


24. Official Tableau Learning Resources

whatsapp